<div class="mainBox">
	<div class="row">
		<div class="col-lg-12">
			<h1 class="page-header">Danh sách sản phẩm</h2>
		</div>
	</div>
	<div class="searchBox">
	<?php
	$contractTypes = array(2002,2,3);
	echo $this->Form->create('Product', array('type' => 'get', 'action' => '/index'));
	echo $this->Form->input('pro_name', array(
		'label' => 'Product name',
		'class' => 'form-control w200',
		'div' => false,
	));
	echo $this->Form->input('pro_category', array(
		'options' => $contractTypes,
		'class' => 'w200',
		'class' => 'form-control w200',
		'div' => false,
	));


	echo $this->Form->submit('Search',array(
			'class' => 'btn btn-primary',
			'id' => 'ProductFilter',
			'title' => 'Search',
			'label' => false,
			'div' => false
		));

	echo $this->Form->end();
	?>
	</div>
</div><!-- /.mainBox -->

<div id="mainTable">
	<div class="row">
		<div class="col-sm-6">
			<?php
			$start = ($this->Paginator->current($model = null) - 1) * $page_number_limit + 1;
			$end = $start + sizeof($datas) - 1;
			?>
			<div class="dataTables_info" id="dataTables-example_info" role="alert" aria-live="polite" aria-relevant="all">Showing <?php echo $start;?> to <?php echo $end;?> of <?php echo $this->Paginator->param('count');?> entries</div>
		</div>
		<div class="col-sm-6">
			<div id="dataTables-example_paginate" class="dataTables_paginate paging_simple_numbers">
				<ul class="pagination flRight box25">
				<?php
				if($this->Paginator->param('count') > $page_number_limit):
					echo $this->Paginator->prev(__('Previous'), array(
						'class' => 'previous',
						'tag' => 'li',
						'disabledTag' => 'a'
					));

					echo $this->Paginator->numbers(array(
						'separator' => '    ',
						'tag' => 'li',
						'currentClass' => 'active',
						'currentTag' => 'a'
					));

					echo $this->Paginator->next(__('Next'), array(
						'class' => 'next',
						'tag' => 'li',
						'disabledTag' =>'a'
					));
				endif;
				?>
				</ul><!-- /.pagination -->
			</div>
		</div>
	</div>
	<table class="table table-striped table-bordered table-hover" id="dataTables-example">
		<thead>
			<tr>
				<th>STT</th>
				<th>Ảnh</th>
				<th>Thông tin chung</th>
				<th>Khuyến mãi</th>
				<th>Ngày tạo <span class="sort"><?php echo $this->Paginator->sort('Product.pro_date', 'Sort'); ?></span></th>
				<th><img alt="sửa" src="<?php echo $this->webroot ?>img/edit.png" class="image"></th>
				<th><img alt="Xóa" src="<?php echo $this->webroot ?>img/delete.gif" class="image"></th>
			</tr>
		</thead>
		<tbody>
			<?php if ($this->Paginator->param('count') > 0) :?>
				<?php
				$countno = ($this->Paginator->current($model = null) - 1) * $page_number_limit;
				foreach ($datas as $key => $shop):
					$countno++;
				?>
				<tr <?php echo $changeBgTr; ?>>
					<td align="center"><?php echo $countno;?></td>
					<td>
						<?php echo $this->Html->image('/uploads/small_'.$shop['Product']['pro_picture'], array('alt' => '', 'fullBase' => false));?>
					<td>
						<table class="child-tbl" border="0" cellpadding="2" cellspacing="1" width="100%">
							<tr>
								<td align="right" width="15%">Danh mục</td>
								<td><input type="text" name="pro_category" id="pro_category" class="form-control" size="40" value="<?php echo $shop['Product']['pro_category']?>"></td>
							</tr>
							<tr>
								<td align="right" >Tên</td>
								<td><input type="text" name="pro_name" id="pro_name" class="form-control" size="40" value="<?php echo $shop['Product']['pro_name']?>"></td>
							</tr>
							<tr>
								<td align="right" >Giá</td>
								<td><input type="text" name="pro_price" id="pro_name" class="form-control" size="40" value="<?php echo $shop['Product']['pro_price']?>"></td>
							</tr>
						</table>
					</td>
					<td>Khuyen mai</td>
					<td><?php echo date('d/m/Y', $shop['Product']['pro_date']);?></td>
					<td><a href="<?php echo $this->Html->url(array('controller' => 'products', 'action' => 'edit', $shop['Product']['pro_id'])) ?>"><?php echo $this->Html->image("edit.png", array("alt" => "sửa", 'class' => 'image'));?></a></td>
					<td>
					<?php
						echo $this->Form->postLink(
							'Delete',
							array('controller' => 'products', 'action' => 'delete', $shop['Product']['pro_id']), null, __('Are you sure you want to delete ?', $shop['Product']['pro_id'])
						);
					?>
					</td>

				</tr>
				<?php endforeach;?>
			<?php endif;?>
		</tbody>
	</table>
	<div class="row">
		<div class="col-sm-6">
			<div class="dataTables_info" id="dataTables-example_info" role="alert" aria-live="polite" aria-relevant="all">Showing <?php echo $start;?> to <?php echo $end;?> of <?php echo $this->Paginator->param('count');?> entries</div>
		</div>
		<div class="col-sm-6">
			<div id="dataTables-example_paginate" class="dataTables_paginate paging_simple_numbers">
				<ul class="pagination flRight box25">
				<?php
				if($this->Paginator->param('count') > $page_number_limit):
					echo $this->Paginator->prev(__('previous'), array(
						'class' => 'previous',
						'tag' => 'li',
						'disabledTag' => 'a'
					));

					echo $this->Paginator->numbers(array(
						'separator' => '    ',
						'tag' => 'li',
						'currentClass' => 'active',
						'currentTag' => 'a'
					));

					echo $this->Paginator->next(__('next'), array(
						'class' => 'next',
						'tag' => 'li',
						'disabledTag' =>'a'
					));
				endif;
				?>
				</ul><!-- /.pagination -->
			</div>
		</div>
	</div>


</div>